import React, {Component} from 'react';
import Iconfont from "../../../utils/iconfont";
import commonConfig from "../../../static/js/commonConfig";
import '../../../static/scss/fileViewer/component/otherFileComponent.scss'

class OtherFileComponent extends Component {

    /*其它文件下载*/
    otherFileDownload = item => {
        window.location.href = commonConfig.downloadFile(item);
    }

    render() {
        const {otherFileList} = this.props;
        return (
            <>
                <div className="other_file_component_module">
                    <ul>
                        {otherFileList.map((item, i) =>
                            <li key={i} className="clearfix">
                                <p>{item.name}</p>
                                <span onClick={this.otherFileDownload.bind(this, item)}>
                                                    <Iconfont type="icon-xiazai1"/>
                                                </span>
                            </li>
                        )}
                    </ul>
                </div>
            </>
        )
    }
}

export default OtherFileComponent